package com.changgou.user.feign;

import com.changgou.entity.Result;
import com.changgou.user.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "user")
public interface UserFeign {
    /**
     * 根据用户名查询用户信息
     * @param username
     * @return
     */
    @GetMapping("/user/load/{username}")
    public User findUserInfo(@PathVariable String username);

    /**
     * 增加会员积分
     * @param points
     * @return
     */
    @PostMapping(value = "/user/points/add")
    public Result addUserPoints(@RequestParam("points") Integer points);
}
